﻿
using System;
namespace NDI
{
    internal class Registration : IRegistration
    {
        public Registration(Type serviceType,object factory)
        {
            this.ServiceType = serviceType;
            this.Factory = factory;
            this.FactoryType = factory.GetType();
        }
        
        public Type ServiceType { get; private set; }
        public object Factory { get; private set; }
        public Type FactoryType { get; private set; }
        public string Name { get; set; }
        public ReuseScope Scope { get; private set; }
        public Owner Owner { get; private set; }

        public IReusedOwned Named(string name)
        {
            this.Name = name;
            return this;
        }

        public IOwned ReuseWithin(ReuseScope reuseScope)
        {
            this.Scope = reuseScope;
            return this;
        }

        public void OwnedBy(Owner owner)
        {
            this.Owner = Owner;
        }
        
    }
}
